{template header}
<h4 style="padding-left:10px;;">
    <span>搜索</span>
    <i class="icon-search"></i>
</h4>
<form class="form-horizontal" method="post" action="">
    <div class="control-group search-group">
        <label class="control-label" >昵称或ID：</label>
        <div class="controls">
          <input type="text" placeholder="请输入用户昵称或ID" name="nickname" value="{$search['nickname']}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">选择性别：</label>
        <div class="controls">
            <select name="gender">
                <option value="">请选择性别</option>
                <option {if $search['gender'] == 1}selected="selected"{/if} value="1">男</option>
                <option {if $search['gender'] == 2}selected="selected"{/if} value="2">女</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">设备类型：</label>
        <div class="controls">
            <select name="device">
                <option value="">请选择设备</option>
                <option {if $search['device'] == 2}selected="selected"{/if} value="2">iOS</option>
                <option {if $search['device'] == 1}selected="selected"{/if} value="1">安卓</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">跑步总次数:</label>
        <div class="controls">
            <input type="text" placeholder="请输入跑步总次数" name="total_rate" value="{$search['total_rate']}">
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">排序类型：</label>
        <div class="controls">
            <select name="sort">
                <option value="vid">游客ID</option>
                <option {if $search['sort'] == 'addtime'}selected="selected"{/if} value="addtime">注册日期</option>
                <option {if $search['sort'] == 'nickname'}selected="selected"{/if} value="nickname">昵称</option>
                <option {if $search['sort'] == 'age'}selected="selected"{/if} value="age">年龄</option>
                <option {if $search['sort'] == 'total_mileage'}selected="selected"{/if} value="total_mileage">总里程</option>
                <option {if $search['sort'] == 'total_rate'}selected="selected"{/if} value="total_rate">次数</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <label class="control-label">排序方式：</label>
        <div class="controls">
            <select name="order">
                <option {if $search['order'] == 'DESC'}selected="selected"{/if} value="DESC">降序</option>
                <option {if $search['order'] == 'ASC'}selected="selected"{/if} value="ASC">升序</option>
            </select>
        </div>
    </div>
    <div class="control-group search-group">
        <div class="controls">
            <input type="hidden" value="search" name="s">
            <button class="btn" type="submit">提交</button>　
            <button class="btn" type="reset">重置</button>
        </div>
    </div>
</form>
<div class="bs-docs-example pt-15" style="clear:both;">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>头像</th>
                <th>用户昵称</th>
                <th>注册日期</th>
                <th>身高</th>
                <th>体重</th>
                <th>性别</th>
                <th>年龄</th>
                <th>里程</th>
                <th>次数</th>
                <th>设备</th>
                <th>Old_Uid</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {loop $userData $k $v}
            <tr>
                <td>
                    <a href="#header_{$k}" data-toggle="modal">
                        <image src="{$v['header']}" width="30" height="30">
                    </a>
                </td>
                <div id="header_{$k}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h3 id="myModalLabel">头像大图</h3>
                    </div>
                    <div class="modal-body" style="height:700px;">
                        <img src="{$v['header']}">
                    </div>
                </div>
                <td><a class="btn btn-link" href="?c=admin&a=userinfo&vid=$v['vid']" target="_blank">{$v['nickname']}</a>
                </td>
                <td>{eval echo date('Y-m-d H:i:s', $v['addtime'])}</td>
                <td>{$v['height']}</td>
                <td>{$v['weight']}</td>
                <td>{if $v['gender'] == 1}男{elseif $v['gender'] == 2}女{else}保密{/if}</td>
                <td>{eval echo $v['age'] > 100 ? (2014 - $v['age']):$v['age']}岁</td>
                <td>{$v['total_mileage']}</td>
                <td>{$v['total_rate']}</td>
                <td>{if $v['client_type'] == 1}安卓{elseif $v['client_type'] == 2}iOS{else}未知{/if}</td>
                <td>{$v['old_uid']}</td>
                <td><!--<a class="btn btn-danger" href="?c=admin&a=delUser&uid=$v['vid']" target="_blank" onclick="return confirm('Are you sure?')">删除用户</a>&nbsp;&nbsp;--><a class="btn btn-primary" target="_blank" href="?c=admin&a=showHistory&uid=$v['vid']&t=2">跑步记录</a>
                </td>
            </tr>
            {/loop}
        </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>

{template footer}
